<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  
  <title>探索如何更方便的管理和部署 hexo 博客 | 四叶草</title>
  
  <meta name="keywords" content="archlinux,linux">
  
  
  <meta name="description" content="一个技术宅的技术分享">
  

  
  <link rel="alternate" href="/atom.xml" title="四叶草">
  

  <meta name="HandheldFriendly" content="True" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <!-- meta -->
  

  <!-- link -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
  
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css">
  

  

  
    
<link rel="stylesheet" href="/style.css">

  

  <script>
    function setLoadingBarProgress(num) {
      document.getElementById('loading-bar').style.width=num+"%";
    }
  </script>

  
  
<meta name="generator" content="Hexo 4.2.1"><link rel="alternate" href="/atom.xml" title="四叶草" type="application/atom+xml">
</head>

<body>
  
  
  <header class="l_header material">
  <div id="loading-bar-wrapper">
    <div id="loading-bar" class="material"></div>
  </div>

	<div class='wrapper'>
		<div class="nav-main container container--flex">
      <a class="logo flat-box" href='/' >
        
          四叶草
        
      </a>
			<div class='menu navgation'>
				<ul class='h-list'>
          
  					
  						<li>
								<a class="nav flat-box" href="/"
                  
                  
                  id="home">
									<i class='fas fa-home fa-fw'></i>&nbsp;主页
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/categories/"
                  
                    rel="nofollow"
                  
                  
                  id="categories">
									<i class='fas fa-folder-open fa-fw'></i>&nbsp;分类
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/tags/"
                  
                    rel="nofollow"
                  
                  
                  id="tags">
									<i class='fas fa-hashtag fa-fw'></i>&nbsp;标签
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/archives/"
                  
                    rel="nofollow"
                  
                  
                  id="archives">
									<i class='fas fa-archive fa-fw'></i>&nbsp;归档
								</a>
							</li>
      			
      		
				</ul>
			</div>

			
				<div class="m_search">
					<form name="searchform" class="form u-search-form">
						<input type="text" class="input u-search-input" placeholder="搜索" />
						<i class="icon fas fa-search fa-fw"></i>
					</form>
				</div>
			
			<ul class='switcher h-list'>
				
					<li class='s-search'><a class="fas fa-search fa-fw" href='javascript:void(0)'></a></li>
				
				<li class='s-menu'><a class="fas fa-bars fa-fw" href='javascript:void(0)'></a></li>
			</ul>
		</div>

		<div class='nav-sub container container--flex'>
			<a class="logo flat-box"></a>
			<ul class='switcher h-list'>
				<li class='s-comment'><a class="flat-btn fas fa-comments fa-fw" href='javascript:void(0)'></a></li>
        
          <li class='s-toc'><a class="flat-btn fas fa-list fa-fw" href='javascript:void(0)'></a></li>
        
			</ul>
		</div>
	</div>
</header>
	<aside class="menu-phone">
    <header>
		<nav class="menu navgation">
      <ul>
        
          
            <li>
							<a class="nav flat-box" href="/"
                
                
                id="home">
								<i class='fas fa-clock fa-fw'></i>&nbsp;近期
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/categories/"
                
                  rel="nofollow"
                
                
                id="categories">
								<i class='fas fa-folder-open fa-fw'></i>&nbsp;分类
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/tags/"
                
                  rel="nofollow"
                
                
                id="tags">
								<i class='fas fa-hashtag fa-fw'></i>&nbsp;标签
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/archives/"
                
                  rel="nofollow"
                
                
                id="archives">
								<i class='fas fa-archive fa-fw'></i>&nbsp;归档
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/about/"
                
                  rel="nofollow"
                
                
                id="about">
								<i class='fas fa-info-circle fa-fw'></i>&nbsp;关于
							</a>
            </li>
          
       
      </ul>
		</nav>
    </header>
	</aside>
<script>setLoadingBarProgress(40);</script>



  <div class="l_body nocover">
    <div class='body-wrapper'>
      <div class='l_main'>
  

  <article id="post" class="post white-box article-type-post" itemscope itemprop="blogPost">
    


  <section class='meta'>
    
    
    <div class="meta" id="header-meta">
      
        
  
    <h1 class="title">
      <a href="/learn/hexo/management/">
        探索如何更方便的管理和部署 hexo 博客
      </a>
    </h1>
  


      
      <div class='new-meta-box'>
        
          
        
          
            
  <div class='new-meta-item author'>
    
      <a href="/about" rel="nofollow">
        
          <i class="fas fa-user" aria-hidden="true"></i>
        
        <p>四叶草🍀</p>
      </a>
    
  </div>


          
        
          
            <div class="new-meta-item date">
  <a class='notlink'>
    <i class="fas fa-calendar-alt" aria-hidden="true"></i>
    <p>2019-11-23</p>
  </a>
</div>

          
        
          
            
  
  <div class='new-meta-item category'>
    <a href='/categories/%E6%8E%A2%E7%A9%B6%E5%AD%A6%E4%B9%A0/' rel="nofollow">
      <i class="fas fa-folder-open" aria-hidden="true"></i>
      <p>探究学习</p>
    </a>
  </div>


          
        
          
            

  <div class="new-meta-item markdown">
    
    
      <a href="https://github.com/fkxxyz/fkxxyz-blog-src/blob/master/source/_posts/learn/hexo/management.md" target="_blank" rel="nofollow noopener">
    
      <i class="fab fa-markdown"></i>
      <p>md源文档</p>
    </a>
  </div>



          
        
          
            

  <div class="new-meta-item download">
    
    
      <a href="https://github.com/fkxxyz/fkxxyz-blog-src/raw/master/source/_posts/learn/hexo/management.md" target="_blank" rel="nofollow noopener">
    
      <i class="fas fa-download"></i>
      <p>下载本文</p>
    </a>
  </div>



          
        
          
            
  
    <div class="new-meta-item browse busuanzi">
      <a class='notlink'>
        <i class="fas fa-eye" aria-hidden="true"></i>
        <p>
          <span id="busuanzi_value_page_pv">
            <i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i>
          </span>
        </p>
      </a>
    </div>
  


          
        
          
            

          
        
      </div>
      
        <hr>
      
    </div>
  </section>


    <section class="article typo">
      <div class="article-entry" itemprop="articleBody">
        <p>在学会使用 hexo 的基本操作后，发现使用和部署的过程中，遇到几个问题，在此罗列出来逐一解决。</p>
<a id="more"></a>

<h2 id="遇到的不便之处"><a href="#遇到的不便之处" class="headerlink" title="遇到的不便之处"></a>遇到的不便之处</h2><ol>
<li>由于使用很多主题的过程中，需要对 _config.yml、模块目录 node_modules 进行大量修改，当想要换主题时，得重新用新的 _config.yml ，如果模块不重装，则可能会有大量不需要的模块留下来。因此，要更换主题，不得不重新初始化建立博客目录，但是博客的源文件保存在 source 里面，重新 hexo init 初始化后，需要又需要保留原来的 source，同样，hexo deploy 部署用的是 .deploy_git 目录，需要备份。</li>
<li>每次 hexo init 时会克隆 hexo-starter 和 hexo-theme-landscape 仓库，而 landscape 主题很大，国内克隆这个大仓库耗费时间，而这个仓库是默认主题，通常是不需要的。</li>
<li>每次 hexo init 后都需要 npm install 来安装模块。</li>
<li>在使用的过程中，如果 source 放到本机，要是本机故障或者突发情况导致 source 目录没了，那么损失会惨重。</li>
</ol>
<h2 id="解决思路"><a href="#解决思路" class="headerlink" title="解决思路"></a>解决思路</h2><p>对于以上问题，想出一些一劳永逸的解决思路。</p>
<ol>
<li>对所有需要保存的重要的东西，托管到 github。</li>
<li>提前保存好一份 hexo-starter 仓库到本地，并且 npm install 之后，将整个目录压缩打包保存到本地，我将它成为博客目录模板，要更换主题时，直接解压使用，大幅度提升效率。</li>
<li>本地存一份保存重要的东西的仓库，包括 source 目录，将 source 目录用符号链接的方式链接到博客的主目录。</li>
<li>将 .deploy_git 放到自己的本地 github 仓库目录 ~/github.com/fkxxyz/fkxxyz.github.io，同样用符号链接的方式链接到博客的主目录。</li>
<li>将主题目录的改动也记录到此仓库，用符号链接的方式对应过去，这里来可以妙用 cp 的 -s 参数。</li>
<li>以上一切可以使用 shell 脚本来自动化，快速快速更换主题，同时 shell 脚本本身也可以算作重要的东西托管到 github。</li>
</ol>
<h2 id="解决方案"><a href="#解决方案" class="headerlink" title="解决方案"></a>解决方案</h2><h3 id="建立重要的仓库"><a href="#建立重要的仓库" class="headerlink" title="建立重要的仓库"></a>建立重要的仓库</h3><p>在 github 上建立一个仓库名为 fkxxyz-blog-src 的仓库，用来保存重要的信息，如配置好的初始 _config.yml 、source 目录、自动化脚本，其中， _config.yml 保存两份，一份是由默认的 _config.yml 模板修改成自己的信息得到，取名为 _config-fkxxyz.yml，一份是由 _config-fkxxyz.yml 修改成当前使用的主题相关的配置。 </p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash"> 克隆刚建好的空仓库</span></span><br><span class="line">cd ~/github.com/fkxxyz</span><br><span class="line">git clone https://github.com/fkxxyz/fkxxyz-blog-src.git</span><br><span class="line">ls</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 保存重要信息到这个仓库</span></span><br><span class="line">cd fkxxyz-blog-src</span><br><span class="line">cp -r ~/myblog/source .</span><br><span class="line">cp ~/myblog/_config.yml _config-fkxxyz.yml</span><br><span class="line">cp ~/myblog/_config.yml .</span><br><span class="line">touch README.md</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 提交上传仓库</span></span><br><span class="line">git add -A</span><br><span class="line">git commit -m 'first commit'</span><br><span class="line">git push</span><br></pre></td></tr></table></figure>

<h3 id="制作好博客目录模板压缩包"><a href="#制作好博客目录模板压缩包" class="headerlink" title="制作好博客目录模板压缩包"></a>制作好博客目录模板压缩包</h3><p>此步骤可以使得以后用解压的方式代替 hexo init + npm install 二连大幅度提升效率。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash"> 克隆 hexo-starter 仓库到临时目录</span></span><br><span class="line">mkdir /tmp/a</span><br><span class="line">cd /tmp/a</span><br><span class="line">git clone https://github.com/hexojs/hexo-starter.git</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 精简 hexo-starter 目录</span></span><br><span class="line">cd hexo-starter</span><br><span class="line">ls -a</span><br><span class="line">rm -rf .*</span><br><span class="line">rm -r source</span><br><span class="line">rm -r themes/landscape</span><br><span class="line">find</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 安装必要的模块</span></span><br><span class="line">npm install</span><br><span class="line">npm install hexo-deployer-git --save</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 打包压缩保存起来</span></span><br><span class="line">cd ..</span><br><span class="line">mv hexo-starter hexo-templete</span><br><span class="line">tar cJf hexo-templete.tar.xz hexo-templete</span><br><span class="line">mv hexo-templete.tar.xz ~/Documents</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 后续清理</span></span><br><span class="line">cd</span><br><span class="line">rm -rf /tmp/a</span><br></pre></td></tr></table></figure>

<p>至此，hexo-templete.tar.xz 已经保存到 ~/Document 里了，后续随时解压使用。</p>
<h3 id="编写一键脚本"><a href="#编写一键脚本" class="headerlink" title="编写一键脚本"></a>编写一键脚本</h3><p>首先设计这个脚本，这个脚本放在 fkxxyz-blog-src 仓库目录中运行，功能是解压指定的博客目录模板压缩包到特定位置，脚本名为 setup。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">cd ~/github.com/fkxxyz/fkxxyz-blog-src</span><br><span class="line">touch setup</span><br><span class="line">chmod +x setup</span><br></pre></td></tr></table></figure>

<p>然后编写 setup，由于以后随时会更新完善，实时内容详见 <a href="https://github.com/fkxxyz/fkxxyz-blog-src/blob/master/setup" target="_blank" rel="noopener">https://github.com/fkxxyz/fkxxyz-blog-src/blob/master/setup</a></p>
<p>为了方便起见再编写两个脚本 gen 和 push， gen 用于复制修改过主题到目标目录，并且一键 hexo clean、hexo generate；push 用于一键 hexo deploy 。</p>
<p>最后，不忘把此仓库复制到服务器。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">git add -A</span><br><span class="line">git commit -m update</span><br><span class="line">git push</span><br></pre></td></tr></table></figure>

<h2 id="测试解决效果"><a href="#测试解决效果" class="headerlink" title="测试解决效果"></a>测试解决效果</h2><p>现在，所有的一切工作都可以在 ~/github.com/fkxxyz/fkxxyz-blog-src 目录里进行了，首先切换到此目录。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cd ~/github.com/fkxxyz/fkxxyz-blog-src</span><br></pre></td></tr></table></figure>

<p>下面开始逐一测试效果。</p>
<h3 id="更换主题"><a href="#更换主题" class="headerlink" title="更换主题"></a>更换主题</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">./setup</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 然后下载 jacman 主题，放到 ~/hexo/themes/jacman</span></span><br></pre></td></tr></table></figure>

<h3 id="生成网站"><a href="#生成网站" class="headerlink" title="生成网站"></a>生成网站</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">./gen</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 然后根据提示打开浏览器，进入地址 http://localhost:4000 进行测试。</span></span><br></pre></td></tr></table></figure>

<h3 id="上传改动"><a href="#上传改动" class="headerlink" title="上传改动"></a>上传改动</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">./push</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 然后打开浏览器，输入自己域名 www.fkxxyz.com 查看效果。</span></span><br></pre></td></tr></table></figure>

<h3 id="写博客"><a href="#写博客" class="headerlink" title="写博客"></a>写博客</h3><p>一切写博客的操作都在当前目录的 source 里，手动复制模板来完成，写完之后，可以 ./gen 生成然后测试，然后 ./push 上传。</p>
<h2 id="尾声"><a href="#尾声" class="headerlink" title="尾声"></a>尾声</h2><p>这下可算是大功告成了，以后再也不怕换主题了，也不会怕丢失什么了，以后终于能够把一切精里放在写博客上了，达到了一劳永逸的效果。</p>
<p>接下来，我打算把我以前写的 md 文档，一个一个格式化，放到此博客上。</p>

      </div>
      
      
        <br>
        


  <section class='meta' id="footer-meta">
    <div class='new-meta-box'>
      
        
          <div class="new-meta-item date" itemprop="dateUpdated" datetime="2019-12-18T18:12:00+08:00">
  <a class='notlink'>
    <i class="fas fa-clock" aria-hidden="true"></i>
    <p>更新于 2019年12月18日</p>
  </a>
</div>

        
      
        
          
  
  <div class="new-meta-item meta-tags"><a class="tag" href="/tags/archlinux/" rel="nofollow"><i class="fas fa-tag" aria-hidden="true"></i><p>archlinux</p></a></div> <div class="new-meta-item meta-tags"><a class="tag" href="/tags/hexo/" rel="nofollow"><i class="fas fa-tag" aria-hidden="true"></i><p>hexo</p></a></div>


        
      
        
          
  <div class="new-meta-item share -mob-share-list">
  <div class="-mob-share-list share-body">
    
      
        <a class="-mob-share-qq" title="QQ好友" rel="external nofollow noopener noreferrer"
          
          href="http://connect.qq.com/widget/shareqq/index.html?url=https://www.fkxxyz.com/learn/hexo/management/&title=探索如何更方便的管理和部署 hexo 博客 | 四叶草&summary=在学会使用 hexo 的基本操作后，发现使用和部署的过程中，遇到几个问题，在此罗列出来逐一解决。"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qq.png">
          
        </a>
      
    
      
        <a class="-mob-share-qzone" title="QQ空间" rel="external nofollow noopener noreferrer"
          
          href="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=https://www.fkxxyz.com/learn/hexo/management/&title=探索如何更方便的管理和部署 hexo 博客 | 四叶草&summary=在学会使用 hexo 的基本操作后，发现使用和部署的过程中，遇到几个问题，在此罗列出来逐一解决。"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qzone.png">
          
        </a>
      
    
      
        <a class="-mob-share-weibo" title="微博" rel="external nofollow noopener noreferrer"
          
          href="http://service.weibo.com/share/share.php?url=https://www.fkxxyz.com/learn/hexo/management/&title=探索如何更方便的管理和部署 hexo 博客 | 四叶草&summary=在学会使用 hexo 的基本操作后，发现使用和部署的过程中，遇到几个问题，在此罗列出来逐一解决。"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/weibo.png">
          
        </a>
      
    
  </div>
</div>



        
      
    </div>
  </section>


      
      
          <div class="prev-next">
              
                  <section class="prev">
                      <span class="art-item-left">
                          <h6><i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;上一页</h6>
                          <h4>
                              <a href="/learn/excel-crack/" rel="prev" title="记一次 excel 文档的密码破解的探索">
                                
                                    记一次 excel 文档的密码破解的探索
                                
                              </a>
                          </h4>
                          
                              
                              <h6 class="tags">
                                  <a class="tag" href="/tags/python/"><i class="fas fa-tag fa-fw" aria-hidden="true"></i> python</a> <a class="tag" href="/tags/%E4%BF%A1%E6%81%AF%E5%AE%89%E5%85%A8/"><i class="fas fa-tag fa-fw" aria-hidden="true"></i> 信息安全</a>
                              </h6>
                          
                      </span>
                  </section>
              
              
                  <section class="next">
                      <span class="art-item-right" aria-hidden="true">
                          <h6>下一页&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i></h6>
                          <h4>
                              <a href="/learn/hexo/" rel="prev" title="探究在 archlinux 上用 hexo 建立个人的博客">
                                  
                                      探究在 archlinux 上用 hexo 建立个人的博客
                                  
                              </a>
                          </h4>
                          
                              
                              <h6 class="tags">
                                  <a class="tag" href="/tags/archlinux/"><i class="fas fa-tag fa-fw" aria-hidden="true"></i> archlinux</a> <a class="tag" href="/tags/hexo/"><i class="fas fa-tag fa-fw" aria-hidden="true"></i> hexo</a>
                              </h6>
                          
                      </span>
                  </section>
              
          </div>
      
    </section>
  </article>



  <!-- 显示推荐文章和评论 -->



  






<!-- 根据页面mathjax变量决定是否加载MathJax数学公式js -->



  <script>
    window.subData = {
      title: '探索如何更方便的管理和部署 hexo 博客',
      tools: true
    }
  </script>


</div>
<aside class='l_side'>
  
    
    
      
      
        
          
          
        
          
          
        
          
          
        
          
          
            
              <section class='widget grid'>
  
<header class='material'>
  <div><i class="fas fa-map-signs fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;站内导航</div>
  
</header>

  <div class='content material'>
    <ul class="grid navgation">
      
        <li><a class="flat-box" title="/" href="/"
          
          
          id="home">
          
            <i class="fas fa-clock fa-fw" aria-hidden="true"></i>
          
          近期文章
        </a></li>
      
        <li><a class="flat-box" title="/archives/" href="/archives/"
          
            rel="nofollow"
          
          
          id="archives">
          
            <i class="fas fa-archive fa-fw" aria-hidden="true"></i>
          
          文章归档
        </a></li>
      
        <li><a class="flat-box" title="/about/" href="/about/"
          
            rel="nofollow"
          
          
          id="about">
          
            <i class="fas fa-info-circle fa-fw" aria-hidden="true"></i>
          
          关于小站
        </a></li>
      
    </ul>
  </div>
</section>

            
          
        
          
          
        
          
          
        
          
          
        
          
          
        
      
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
            
              
  <section class='widget category'>
    
<header class='material'>
  <div><i class="fas fa-folder-open fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;文章分类</div>
  
    <a class="rightBtn"
    
      rel="nofollow"
    
    
    href="/categories/"
    title="categories/">
    <i class="fas fa-expand-arrows-alt fa-fw"></i></a>
  
</header>

    <div class='content material'>
      <ul class="entry">
        
          <li><a class="flat-box" title="/categories/%E5%8E%9F%E5%88%9B%E5%BC%80%E5%8F%91/" href="/categories/%E5%8E%9F%E5%88%9B%E5%BC%80%E5%8F%91/"><div class='name'>原创开发</div><div class='badge'>(5)</div></a></li>
        
          <li><a class="flat-box" title="/categories/%E6%8E%A2%E7%A9%B6%E5%AD%A6%E4%B9%A0/" href="/categories/%E6%8E%A2%E7%A9%B6%E5%AD%A6%E4%B9%A0/"><div class='name'>探究学习</div><div class='badge'>(6)</div></a></li>
        
          <li><a class="flat-box" title="/categories/%E6%95%99%E7%A8%8B/" href="/categories/%E6%95%99%E7%A8%8B/"><div class='name'>教程</div><div class='badge'>(7)</div></a></li>
        
          <li><a class="flat-box" title="/categories/%E8%AE%B0%E5%BD%95/" href="/categories/%E8%AE%B0%E5%BD%95/"><div class='name'>记录</div><div class='badge'>(1)</div></a></li>
        
      </ul>
    </div>
  </section>


            
          
        
          
          
        
          
          
        
          
          
        
      
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
            
              
  <section class='widget tagcloud'>
    
<header class='material'>
  <div><i class="fas fa-tags fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;热门标签</div>
  
    <a class="rightBtn"
    
      rel="nofollow"
    
    
    href="/tags/"
    title="tags/">
    <i class="fas fa-expand-arrows-alt fa-fw"></i></a>
  
</header>

    <div class='content material'>
      <a href="/tags/archlinux/" style="font-size: 24px; color: #555">archlinux</a> <a href="/tags/fcitx/" style="font-size: 16.5px; color: #888">fcitx</a> <a href="/tags/hexo/" style="font-size: 16.5px; color: #888">hexo</a> <a href="/tags/linux/" style="font-size: 19px; color: #777">linux</a> <a href="/tags/php/" style="font-size: 14px; color: #999">php</a> <a href="/tags/python/" style="font-size: 21.5px; color: #666">python</a> <a href="/tags/rime/" style="font-size: 14px; color: #999">rime</a> <a href="/tags/sed/" style="font-size: 14px; color: #999">sed</a> <a href="/tags/shell/" style="font-size: 14px; color: #999">shell</a> <a href="/tags/wine/" style="font-size: 16.5px; color: #888">wine</a> <a href="/tags/%E4%BF%A1%E6%81%AF%E5%AE%89%E5%85%A8/" style="font-size: 16.5px; color: #888">信息安全</a> <a href="/tags/%E5%89%8D%E7%AB%AF/" style="font-size: 14px; color: #999">前端</a> <a href="/tags/%E5%8D%B3%E5%85%B4%E4%BC%B4%E5%A5%8F/" style="font-size: 14px; color: #999">即兴伴奏</a> <a href="/tags/%E5%8F%8C%E6%98%BE%E5%8D%A1%E5%88%87%E6%8D%A2/" style="font-size: 14px; color: #999">双显卡切换</a> <a href="/tags/%E5%92%8C%E5%BC%A6/" style="font-size: 14px; color: #999">和弦</a> <a href="/tags/%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE/" style="font-size: 16.5px; color: #888">思维导图</a> <a href="/tags/%E6%A1%8C%E9%9D%A2%E7%8E%AF%E5%A2%83/" style="font-size: 14px; color: #999">桌面环境</a> <a href="/tags/%E7%9A%AE%E8%82%A4/" style="font-size: 14px; color: #999">皮肤</a> <a href="/tags/%E8%BE%93%E5%85%A5%E6%B3%95/" style="font-size: 16.5px; color: #888">输入法</a> <a href="/tags/%E9%9F%B3%E4%B9%90/" style="font-size: 14px; color: #999">音乐</a>
    </div>
  </section>


            
          
        
          
          
        
          
          
        
      
        
          
          
        
          
          
        
          
          
            
              
  <section class='widget toc-wrapper'>
    
<header class='material'>
  <div><i class="fas fa-list fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;本文目录</div>
  
    <!-- <div class='wrapper'><a class="s-toc rightBtn" rel="external nofollow noopener noreferrer" href="javascript:void(0)"><i class="fas fa-thumbtack fa-fw"></i></a></div> -->
  
</header>

    <div class='content material'>
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#遇到的不便之处"><span class="toc-text">遇到的不便之处</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#解决思路"><span class="toc-text">解决思路</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#解决方案"><span class="toc-text">解决方案</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#建立重要的仓库"><span class="toc-text">建立重要的仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#制作好博客目录模板压缩包"><span class="toc-text">制作好博客目录模板压缩包</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#编写一键脚本"><span class="toc-text">编写一键脚本</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#测试解决效果"><span class="toc-text">测试解决效果</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#更换主题"><span class="toc-text">更换主题</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#生成网站"><span class="toc-text">生成网站</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#上传改动"><span class="toc-text">上传改动</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#写博客"><span class="toc-text">写博客</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#尾声"><span class="toc-text">尾声</span></a></li></ol>
    </div>
  </section>


            
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
      
    

  
</aside>

<footer id="footer" class="clearfix">
  
  
    <div class="social-wrapper">
      
        
          <a href="/atom.xml"
            class="social fas fa-rss flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="mailto:fkxxyz@163.com"
            class="social fas fa-envelope flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="https://github.com/fkxxyz"
            class="social fab fa-github flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="https://ti.qq.com/open_qq/index2.html?url=mqqapi%3a%2f%2fuserprofile%2ffriend_profile_card%3fsrc_type%3dweb%26version%3d1.0%26source%3d2%26uin%3d396519827"
            class="social fab fa-qq flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
    </div>
  
  <br>
  <div><p>博客内容遵循 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" target="_blank" rel="noopener">署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议</a></p>
</div>
  <div>
    本站使用
    <a href="https://xaoxuu.com/wiki/material-x/" target="_blank" class="codename">Material X</a>
    作为主题
    
      ，
      总访问量为
      <span id="busuanzi_value_site_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
      次
    
    。
  </div>
</footer>
<script>setLoadingBarProgress(80);</script>


      <script>setLoadingBarProgress(60);</script>
    </div>
    <a class="s-top fas fa-arrow-up fa-fw" href='javascript:void(0)'></a>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>

  <script>
    var GOOGLE_CUSTOM_SEARCH_API_KEY = "";
    var GOOGLE_CUSTOM_SEARCH_ENGINE_ID = "";
    var ALGOLIA_API_KEY = "";
    var ALGOLIA_APP_ID = "";
    var ALGOLIA_INDEX_NAME = "";
    var AZURE_SERVICE_NAME = "";
    var AZURE_INDEX_NAME = "";
    var AZURE_QUERY_KEY = "";
    var BAIDU_API_ID = "";
    var SEARCH_SERVICE = "hexo" || "hexo";
    var ROOT = "/"||"/";
    if(!ROOT.endsWith('/'))ROOT += '/';
  </script>

<script src="//instant.page/1.2.2" type="module" integrity="sha384-2xV8M5griQmzyiY3CDqh1dn4z3llDVqZDqzjzcY+jCBCk/a5fXJmuZ/40JJAPeoU"></script>




  <script async src="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-busuanzi@2.3/js/busuanzi.pure.mini.js"></script>




  
  
  
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.4/jquery.backstretch.min.js"></script>
    <script type="text/javascript">
      $(function(){
        if ('') {
          $('').backstretch(
          ["/img/background.jpg"],
          {
            duration: "6000",
            fade: "2500"
          });
        } else {
          $.backstretch(
          ["/img/background.jpg"],
          {
            duration: "6000",
            fade: "2500"
          });
        }
      });
    </script>
  











  
<script src="/js/app.js"></script>



  
<script src="/js/search.js"></script>





<!-- 复制 -->
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  let COPY_SUCCESS = "复制成功";
  let COPY_FAILURE = "复制失败";
  /*页面载入完成后，创建复制按钮*/
  !function (e, t, a) {
    /* code */
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '  <i class="fa fa-copy"></i><span>复制</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });

      clipboard.on('success', function(e) {
        //您可以加入成功提示
        console.info('Action:', e.action);
        console.info('Text:', e.text);
        console.info('Trigger:', e.trigger);
        success_prompt(COPY_SUCCESS);
        e.clearSelection();
      });
      clipboard.on('error', function(e) {
        //您可以加入失败提示
        console.error('Action:', e.action);
        console.error('Trigger:', e.trigger);
        fail_prompt(COPY_FAILURE);
      });
    }
    initCopyCode();

  }(window, document);

  /**
   * 弹出式提示框，默认1.5秒自动消失
   * @param message 提示信息
   * @param style 提示样式，有alert-success、alert-danger、alert-warning、alert-info
   * @param time 消失时间
   */
  var prompt = function (message, style, time)
  {
      style = (style === undefined) ? 'alert-success' : style;
      time = (time === undefined) ? 1500 : time*1000;
      $('<div>')
          .appendTo('body')
          .addClass('alert ' + style)
          .html(message)
          .show()
          .delay(time)
          .fadeOut();
  };

  // 成功提示
  var success_prompt = function(message, time)
  {
      prompt(message, 'alert-success', time);
  };

  // 失败提示
  var fail_prompt = function(message, time)
  {
      prompt(message, 'alert-danger', time);
  };

  // 提醒
  var warning_prompt = function(message, time)
  {
      prompt(message, 'alert-warning', time);
  };

  // 信息提示
  var info_prompt = function(message, time)
  {
      prompt(message, 'alert-info', time);
  };

</script>


<!-- fancybox -->
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<script>
  let LAZY_LOAD_IMAGE = "";
  $(".article-entry").find("fancybox").find("img").each(function () {
      var element = document.createElement("a");
      $(element).attr("data-fancybox", "gallery");
      $(element).attr("href", $(this).attr("src"));
      /* 图片采用懒加载处理时,
       * 一般图片标签内会有个属性名来存放图片的真实地址，比如 data-original,
       * 那么此处将原本的属性名src替换为对应属性名data-original,
       * 修改如下
       */
       if (LAZY_LOAD_IMAGE) {
         $(element).attr("href", $(this).attr("data-original"));
       }
      $(this).wrap(element);
  });
</script>





  <script>setLoadingBarProgress(100);</script>
</body>
</html>
